from aiogram.types import (
    ReplyKeyboardMarkup,
    KeyboardButton,
    InlineKeyboardButton,
    InlineKeyboardMarkup,
)


users = ['Кузьмина', 'Кузьмина2']

auth_inline = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="отправить заявку", callback_data="auth")
        ]
    ],
    resize_keyboard=True
)

# auth_kb = ReplyKeyboardMarkup(
#     keyboard=[
#         [
#             KeyboardButton(text=user.name) for user in users
#         ]
#     ],
#     resize_keyboard=True,
#     one_time_keyboard=True,
#     input_field_placeholder="Выберите действие",
#     selective=True
# )

tech_actions = ReplyKeyboardMarkup(
    keyboard=[
        [
            KeyboardButton(text="Журнал обходов"),
            KeyboardButton(text="Осмотр конетейнеров"),
            KeyboardButton(text="Закрыть смену")
        ]
    ],
    resize_keyboard=True,
    one_time_keyboard=True,
    input_field_placeholder="Выберите действие",
    selective=True
)

ref_opt = ReplyKeyboardMarkup(
    keyboard=[
        [
            KeyboardButton(text="Отмена заявки"),
        ]
    ],
    resize_keyboard=True,
    one_time_keyboard=True,
    input_field_placeholder="Выберите действие",
    selective=True
)

ref_opt = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Отмена заявки", callback_data="canceling_exercise")
        ],
    ],
    resize_keyboard=True
)


ref_cancel_not = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Отмена", callback_data="can_exer")
        ],
    ],
    resize_keyboard=True
)


fin_work = ReplyKeyboardMarkup(
    keyboard=[
        [
            KeyboardButton(text="Подтвердить"),
        ]
    ],
    resize_keyboard=True,
    one_time_keyboard=True,
    input_field_placeholder="Выберите действие",
    selective=True
)

for_start = ReplyKeyboardMarkup(
    keyboard=[
        [
            KeyboardButton(text="/start"),
        ]
    ],
    resize_keyboard=True,
    one_time_keyboard=True,
    input_field_placeholder="Выберите действие",
    selective=True
)

# the_start = ReplyKeyboardMarkup(
#     keyboard=[
#         [
#             KeyboardButton(text="/start"),
#         ]
#     ],
#     resize_keyboard=True,
#     one_time_keyboard=True,
#     input_field_placeholder="Выберите действие",
#     selective=True
# )

the_start = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Подтвердите", callback_data="start")
        ]
    ],
    resize_keyboard=True
)

insp_kb = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Подтвердите температуру", callback_data="confirm_temp"),
            InlineKeyboardButton(text="Ввести повторно", callback_data="reply_temp")
        ]
    ],
    resize_keyboard=True
)


async def user_list_kb(dict_data: list):
    actions_ref = InlineKeyboardMarkup(
        inline_keyboard=[

            [InlineKeyboardButton(text=dict_data['value'][i]['ПолноеНаименование'], callback_data='Ref-Key_' + dict_data['value'][i]['Ref_Key'])] for i in range(len(dict_data['value']))

        ],
        resize_keyboard=True
    )
    return actions_ref

# async def user_list_kb(dict_data: list):
#     actions_ref = ReplyKeyboardMarkup(
#         keyboard=[
#             [
#                 KeyboardButton(text=dict_data['value'][i]['ПолноеНаименование']) for i in range(len(dict_data['value']))
#             ],
#             [KeyboardButton(text='Назад')],
#         ],
#         resize_keyboard=True,
#         one_time_keyboard=True
#     )
#     return actions_ref

ref_control = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Редактировать температуру", callback_data="confirm_temp"),
        ],
        [
            InlineKeyboardButton(text="Отключить", callback_data="connect"),
        ],
        [
            InlineKeyboardButton(text="Отмена", callback_data="cancel_appl"),
            InlineKeyboardButton(text="Сохранить", callback_data="save_data")
        ]
    ],
    resize_keyboard=True
)

ref_control2 = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Подключить", callback_data="connect"),
        ],
        [
            InlineKeyboardButton(text="Отмена", callback_data="cancel_appl"),
            InlineKeyboardButton(text="Сохранить", callback_data="cancel_appl"),
        ]
    ],
    resize_keyboard=True
)


ref_inspection = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Редактировать температуру", callback_data="confirm_temp"),
        ],
        [
            InlineKeyboardButton(text="Завершить", callback_data="cancel_appl"),
            InlineKeyboardButton(text="Сохранить", callback_data="back_ref_menu")
        ]
    ],
    resize_keyboard=True
)


ref_temp = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="- 1", callback_data="minus_temp"),
            InlineKeyboardButton(text="- 0.1", callback_data="minus_temp-0.1"),
            InlineKeyboardButton(text="+ 0.1", callback_data="plus_temp-0.1"),
            InlineKeyboardButton(text="+ 1", callback_data="plus_temp"),
        ],
        [
            InlineKeyboardButton(text="Указать температуру", callback_data="temp"),
        ],
        [
            InlineKeyboardButton(text="Завершить", callback_data="back_ref_menu"),
            InlineKeyboardButton(text="Сохранить", callback_data="save_ref_menu")
        ]
    ],
    resize_keyboard=True
)


select_jurnal = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Текущий журнал", callback_data="one_jurnal"),
            InlineKeyboardButton(text="Новый журнал", callback_data="new_jurnyl"),
        ],
        [
            InlineKeyboardButton(text="Назад", callback_data="go_back"),
        ],
    ],
    resize_keyboard=True
)

ref_jr_control = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Загрузите фото монитора", callback_data="jr_photo_ref"),
        ],
        [
            InlineKeyboardButton(text="Редактировать температуру", callback_data="jr_edit_temp"),
        ],
        [
            InlineKeyboardButton(text="Указать ошибки", callback_data="jr_erorrs_ref"),
        ],
        [
            InlineKeyboardButton(text="Завершить", callback_data="js_cancel"),
            InlineKeyboardButton(text="Сохранить", callback_data="js_save_data")
        ]
    ],
    resize_keyboard=True
)

js_ref_temp = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="- 1", callback_data="js_minus_temp"),
            InlineKeyboardButton(text="- 0.1", callback_data="js_minus_temp-0.1"),
            InlineKeyboardButton(text="+ 0.1", callback_data="js_plus_temp-0.1"),
            InlineKeyboardButton(text="+ 1", callback_data="js_plus_temp"),
        ],
        [
            InlineKeyboardButton(text="Указать температуру", callback_data="js_temp"),
        ],
        [
            InlineKeyboardButton(text="Отмена", callback_data="js_cancel_ref"),
            InlineKeyboardButton(text="Сохранить", callback_data="js_save_temp")
        ]
    ],
    resize_keyboard=True
)

# js_ref_opt = ReplyKeyboardMarkup(
#     keyboard=[
#         [
#             KeyboardButton(text="Отмена"),
#         ]
#     ],
#     resize_keyboard=True,
#     one_time_keyboard=True,
#     input_field_placeholder="Выберите действие",
#     selective=True
# )


js_ref_opt = InlineKeyboardMarkup(
    inline_keyboard=[
        [
            InlineKeyboardButton(text="Отмена", callback_data="canceling_rj"),
        ],
    ],
    resize_keyboard=True
)